package abstractDemo;

abstract  class Animal{
    int i=1;
    abstract void eat() ;
    public static void main(String[] args) {
        System.out.println(1);
    }
}

class Cat extends Animal {
    void catchMouse(){}
    void eat() {
        Animal a=new Cat();
        if(a instanceof  Cat){//为了避免类型转化失败，判断a对象是否是由Cat类创建的
            Cat c=(Cat)a;
            c.catchMouse();
        }
    }
}
















public class AB1 extends Animal {
    void eat() {

    }
}





